package com.lanou3g.farmdoctor.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.GridView;

/**
 * Created by ChenFengYao on 15/11/26.
 */
public class NoScrollGV extends GridView {
    public NoScrollGV(Context context) {
        super(context);
    }

    public NoScrollGV(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NoScrollGV(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    /**
     * 禁止滚动
     */
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
    {
        int expandSpec = View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                View.MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);

    }
}
